# coding: utf-8
from flask_sqlalchemy import SQLAlchemy


db = SQLAlchemy()



class CommentInfo(db.Model):
    __tablename__ = 'comment_info'

    AutoID = db.Column(db.BigInteger, primary_key=True, info='主键自增')
    CommentPostID = db.Column(db.BigInteger, nullable=False, index=True, info='对应文章ID')
    CommentUserID = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'), nullable=False, index=True, info='评论的用户id')
    CommentContent = db.Column(db.String(500, 'utf8mb4_0900_ai_ci'))
    CommentParent = db.Column(db.BigInteger, info='父评论id')
    CommentRoot = db.Column(db.BigInteger, info='根评论')
    IsRead = db.Column(db.Integer, server_default=db.FetchedValue(), info='0-未阅读，1-已阅读')
    IsDelete = db.Column(db.Integer, server_default=db.FetchedValue(), info='状态0-正常，1-删除')
    CreateTime = db.Column(db.DateTime, server_default=db.FetchedValue())
    ModifyTime = db.Column(db.DateTime, server_default=db.FetchedValue())
